#define _CRT_SECURE_NO_WARNINGS

//#include  <stdio.h>
//double f1(double  x)
//{
//    return x * x;
//}
//double f2(double  x, double  y)
//{
//    return  x * y;
//}
///**********found**********/
//double fun(int  i, double  x, double  y)
//{
//    if (i == 1)
//        /**********found**********/
//        return f1(x);
//    else
//        /**********found**********/
//        return  f2(x, y);
//}
//main()
//{
//    double  x1 = 5, x2 = 3, r;
//    r = fun(1, x1, x2);
//    r += fun(2, x1, x2);
//    printf("\nx1=%f, x2=%f, x1*x1+x1*x2=%f\n\n", x1, x2, r);
//}

//#include <conio.h>
//#include <stdio.h>
///*************found**************/
//char* fun(char* s, char* t)
//{
//	int s1 = 0, t1 = 0;
//	char* ss, * tt;
//	ss = s;
//	tt = t;
//	while (*ss)
//	{
//		s1++;
//		/*************found**************/
//		ss++;
//	}
//	while (*tt)
//	{
//		t1++;
//		/*************found**************/
//		tt++;
//	}
//	if (t1 > s1)
//		return t;
//	else
//		return s;
//}
//void main()
//{
//	char a[80], b[80];
//	printf("\nEnter a string : ");
//	gets(a);
//	printf("\nEnter a string again: ");
//	gets(b);
//	printf("\nThe longer is :\n\n%s\n", fun(a, b));
//}


#include <stdio.h>
#include <string.h>
#define   N    80
void fun(char* w, int  m)
{
	char tmp[80];
	int k = 0;
	for (int i = m; i < strlen(w); ++i)
	{
		tmp[k++] = w[i];
	}
	for (int i = 0; i < m; i++)
	{
		tmp[k++] = w[i];
	}
	tmp[k] = '\0';
	strcpy(w, tmp);
}
void main()
{
	FILE* wf;
	char  a[N] = "ABCDEFGHIJK", b[N] = "ABCDEFGHIJK";
	int  m;
	printf("The origina string :\n");
	puts(a);
	printf("\n\nEnter  m: ");
	scanf("%d", &m);
	fun(a, m);
	printf("\nThe string after moving :\n");
	puts(a);
	printf("\n\n");
	/******************************/
	wf = fopen("out.dat", "w");
	fun(b, 3);
	fprintf(wf, "%s", b);
	fclose(wf);
	/*****************************/
}
